matrix
	//This is where the Data is stored, sadly numeric vars only seem to cover 16 bit, so we need a list...
	//More investigation neede tough
	//UPDATE: Actually BYOND uses 32bit float numbers -> we have 24 precise bits, we could use 31 or 32 tough eventually, since we work with bitflags

	var/list/bitrow
	var/rows
	var/columns

	//Constructor for Zero/One Matrix
	New(w as num, h as num, val as num){
		src.bitrow = new/list()
		for(var/i = 0, i < w, i++){
			for(var/j = 0, j < h, j++){
				src.bitrow.Add(val)
			}
		}
		src.columns = w
		src.rows = h
	}

	proc/print(){
		world << "Matrix:\ncolumns:	[columns],	rows:	[rows]"
		var/count = 1
		for(var/i = 0, i < src.rows, i++){
			var/str
			for(var/j = 0, j < src.columns, j++){
				str += "[src.bitrow[count]]	"
				count++
			}
			world << str
		}
	}

	proc/invertBits(){
		//world << src.bitrow.len
		for(var/i = 0, i < src.bitrow.len, i++){
			//Arrays in this language are kindof strange...
			src.bitrow[i+1] = !src.bitrow[i+1]	//invert the bits!
		}
	}

	proc/and(var/matrix/M){
		//security check
		if(src.bitrow.len == M.bitrow.len && src.rows == M.rows && src.columns == M.columns){

			var/matrix/R = new/matrix(src.columns,src.rows,FALSE)

			for(var/i = 0, i < src.bitrow.len, i++){
				//AND'ed and set
				R.bitrow[i+1] = (src.bitrow[i+1] & M.bitrow[i+1])
			}
			return R

		}else{
			world << "ERROR: Matrices are not of the same dimensions."
		}

	}
